import { createBrowserRouter } from "react-router";
import ElementsPage from '@/views/ElementsPage';
import HooksPage from '@/views/HooksPage';
import App from '@/App';

let router = createBrowserRouter([
  {
    path: "/",
    Component: App,
    children: [
      {
        index: true,
        Component: HooksPage,
        state: '111',
        meta: {
          title: 'Hooks'
        }
      },
      {
        path: "elements",
        Component: ElementsPage,
        meta: {
          title: '组件'
        }
      }
    ]
    // children: [
    //   {
    //     path: "shows/:showId",
    //     Component: Show,
    //     loader: ({ request, params }) =>
    //       fetch(`/api/show/${params.id}.json`, {
    //         signal: request.signal,
    //       }),
    //   },
    // ],
  },

]);

export default router